package com.jinzhi.jzweb.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.CoreServiceImpl;
import com.jinzhi.jzapi.training.pojo.ChaItemBankVo;
import com.jinzhi.jzweb.dao.ChapterItemBankDao;
import com.jinzhi.jzweb.domain.ChapterItemBankDO;
import com.jinzhi.jzweb.service.ChapterItemBankService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 章节题库表
 * </pre>
 * <small> 2020-02-24 21:00:11 | lance</small>
 */
@Service
public class ChapterItemBankServiceImpl extends CoreServiceImpl<ChapterItemBankDao, ChapterItemBankDO> implements ChapterItemBankService {

    @Override
    public Page<Map> selCibankIdLists(int current, int number, Map map) {

        // 新建分页
        Page<Map> page = new Page<Map>(current, number);

        // 根据情况，返回分页结果
        return page.setRecords(this.baseMapper.selCibankIdLists(page,map));
    }

    @Override
    public List<ChaItemBankVo> selRandItemList(Long chapterId){
        return this.baseMapper.selRandItemList(chapterId);
    }
}
